import mitt from 'mitt'

const emitter = mitt()

let cachedMap = null

emitter.on('map-ready', map => {
  cachedMap = map
})

emitter.getMap = () => cachedMap

export default emitter
